(The overall Attack power, seen in the STAT menu, is the sum of two parts:
 - A constant based on the character's level, which is already in variable $0A3F.
 - The weapon's battle power, with a 25% bonus for swords.)

[... more of function]

8F/845B: AE BA 0A     LDX $0ABA     (Unique index of weapon held)
8F/845E: F0 54        BEQ $84B4     (if we're empty handed, skip all this)
8F/8460: E0 1A 00     CPX #$001A    (is it a Bazooka?)
8F/8463: D0 20        BNE $8485     (if not, branch)

8F/8465: AD 3F 0A     LDA $0A3F     (get our level-based attack modifier)

8F/8468: 18           CLC
8F/8469: 69 12 00     ADC #$0012    (give 18 Battle Power to bazooka as a bludgeon)
8F/846C: 8D 68 14     STA $1468
8F/846F: AF 49 23 7E  LDA $7E2349   (type of Bazooka shell currently loaded)
8F/8473: 29 FF 00     AND #$00FF    (just look at bottom 8 bits)
8F/8476: AA           TAX
8F/8477: BF 8E 38 C4  LDA $C4388E,X   (get a 16-bit pointer to this ammo's Battle Power)
8F/847B: AA           TAX
8F/847C: BF 00 00 C4  LDA $C40000,X   (get the Battle Power)
8F/8F80: 8D 3F 0A     STA $0A3F       (note it's overwriting the level-based attack modifier
                                       rather than adding to it)
8F/8483: 80 2F        BRA $84B4


8F/8485: 86 12        STX $12       (save index for later)

8F/8487: BF 74 38 C4  LDA $C43874,X    (get a 16-bit pointer to weapon's Battle Power)
8F/848B: AA           TAX
8F/848C: BF 00 00 C4  LDA $C40000,X    (get the Battle Power)

8F/8490: 18           CLC
8F/8491: 6D 3F 0A     ADC $0A3F
8F/8494: 8D 3F 0A     STA $0A3F        (add it to our level-based Attack modifier)

8F/8497: A6 12        LDX $12          (read unique weapon index again)


( Silver Sheath check would likely go here )

8F/8499: BF DC 59 C4  LDA $C459DC,X    (weapon type?  Sword = 0, Axe = 2,
                                        Spear = 4, Bazooka = 6)
8F/849D: C9 00 00     CMP #$0000   (is it a sword?)
8F/84A0: D0 12        BNE $84B4    (if not, branch)

(Or maaaybe, the Sheath check could be put here...)


8F/84A2: BF 74 38 C4  LDA $C43874,X
8F/84A6: AA           TAX
8F/84A7: BF 00 00 C4  LDA $C40000,X   (get the weapon Battle Power again)

8F/84AB: 4A           LSR
8F/84AC: 4A           LSR         (divide by 4)

8F/84AD: 18           CLC
8F/84AE: 6D 3F 0A     ADC $0A3F

8F/84B1: 8D 3F 0A     STA $0A3F  (Swords end up with 5/4 Battle Power added to our level-based value)

(At this point, $0A3F will hold the Attack stat, although the Bazooka may revert to the value
 in $1468 if it runs out of shells or it's used when it's not charged yet.)

[more of function...]
